<?php 

namespace app\admin\model;


use think\Model;
use think\model\concern\SoftDelete;

class WorkJournal extends Model
{
    use SoftDelete;
    protected $name = 'journals';


	const WEEK = 1; //周
    const MONTH = 2; //月
    const QUARTER = 3; //季度
    const YEAR = 4; //年


    public function JournalType()
    {
    	return $this->belongsTo(JournalType::class,'journal_type_id');
    }


	public function JournaLevel()
    {
    	return $this->belongsTo(JournaLevel::class,'journal_level_id');
    }


    public function Admin()
    {
        return $this->belongsTo(Admin::class,'approval_admin_id');
    }

    public function week(){
        return $this->hasMany(JournWeek::class,'journ_id');
    }

}